import matplotlib.pyplot as plt
import numpy as np

boxes=np.array([
            [100,100,210,210,0.72],#0
            [280,290,420,420,0.8],#1
            [220,220,320,330,0.92],#2
            [105,90,220,210,0.71],#3
            [230,240,325,330,0.81],#4
            [305,300,420,420,0.9],#5
            [215,225,305,328,0.6],#6
            [150,260,290,400,0.99],#7
            [102,108,208,208,0.72]])#8  #9个框
x1 = boxes[:, 0]
y1 = boxes[:, 1]
x2 = boxes[:, 2]
y2 = boxes[:, 3]
scores = boxes[:, 4]

plt.figure(figsize=[8, 8])
plt.xlim((60,450))
plt.ylim((450,60))

plt.scatter(x1, y1, s=25, c='b', alpha=0.6)#框左上角蓝色
plt.scatter(x2, y2, s=25, c='r', alpha=0.6)#框右下角红色

plt.plot([x1, x2], [y1, y1])
plt.plot([x1, x2], [y2, y2])
plt.plot([x1, x1], [y1, y2])
plt.plot([x2, x2], [y1, y2])

for i, box in enumerate(boxes):
    plt.annotate(f'#{i}:{scores[i]}', xy=[box[0], box[1]])

plt.show()
